package com.example.jdkDynamic;

import org.springframework.cglib.proxy.Enhancer;

/**
 * TODO: 这里要写注释的!
 */
public class Main2 {
    public static void main(String[] args) {
        CglibProxy cglibProxy= new CglibProxy();
        Enhancer enhancer= new Enhancer();
        enhancer.setSuperclass(UserServiceImpl.class);
        enhancer.setCallback(cglibProxy);
        UserService userService= (UserService) enhancer.create();
        userService.getName(1);
        userService.getAge(1);
    }
}
